<?php
class RSSReader {
	public function reader($array) {
		$doc = new DOMDocument ();
		$index = 0;
		$feeds = array ();
		$temp = array ();
		foreach ( $array as $item ) {
			$doc->load ( $item );
			foreach ( $doc->getElementsByTagName ( 'item' ) as $node ) {
				$itemRSS = array (
						'title' => $node->getElementsByTagName ( 'title' )->item ( 0 )->nodeValue,
						'desc' => $node->getElementsByTagName ( 'description' )->item ( 0 )->nodeValue,
						'link' => @$node->getElementsByTagName ( 'link' )->item ( 0 )->nodeValue,
						'date' => @$node->getElementsByTagName ( 'pubDate' )->item ( 0 )->nodeValue 
				);
				array_push ( $temp, $itemRSS );
			}
			array_push ( $feeds, $temp );
			$index++;
		}
		return $feeds;
	}
}

